package com.ftg.demo1.service.impl;

import java.util.List;
import com.ftg.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ftg.demo1.mapper.DemoUserMapper;
import com.ftg.demo1.domain.DemoUser;
import com.ftg.demo1.service.IDemoUserService;

/**
 * 测试功能类Service业务层处理
 * 
 * @author kangjx
 * @date 2023-12-20
 */
@Service
public class DemoUserServiceImpl implements IDemoUserService 
{
    @Autowired
    private DemoUserMapper demoUserMapper;

    /**
     * 查询测试功能类
     * 
     * @param id 测试功能类主键
     * @return 测试功能类
     */
    @Override
    public DemoUser selectDemoUserById(Long id)
    {
        return demoUserMapper.selectDemoUserById(id);
    }

    /**
     * 查询测试功能类列表
     * 
     * @param demoUser 测试功能类
     * @return 测试功能类
     */
    @Override
    public List<DemoUser> selectDemoUserList(DemoUser demoUser)
    {
        return demoUserMapper.selectDemoUserList(demoUser);
    }

    /**
     * 新增测试功能类
     * 
     * @param demoUser 测试功能类
     * @return 结果
     */
    @Override
    public int insertDemoUser(DemoUser demoUser)
    {
        demoUser.setCreateTime(DateUtils.getNowDate());
        return demoUserMapper.insertDemoUser(demoUser);
    }

    /**
     * 修改测试功能类
     * 
     * @param demoUser 测试功能类
     * @return 结果
     */
    @Override
    public int updateDemoUser(DemoUser demoUser)
    {
        demoUser.setUpdateTime(DateUtils.getNowDate());
        return demoUserMapper.updateDemoUser(demoUser);
    }

    /**
     * 批量删除测试功能类
     * 
     * @param ids 需要删除的测试功能类主键
     * @return 结果
     */
    @Override
    public int deleteDemoUserByIds(Long[] ids)
    {
        return demoUserMapper.deleteDemoUserByIds(ids);
    }

    /**
     * 删除测试功能类信息
     * 
     * @param id 测试功能类主键
     * @return 结果
     */
    @Override
    public int deleteDemoUserById(Long id)
    {
        return demoUserMapper.deleteDemoUserById(id);
    }
}
